import request from '@/utils/request'
import Qs from 'qs'

export function createDevice(productId) {
  return request({
    url: '/device.dev/create',
    method: 'post',
    data: Qs.stringify({ productId })
  })
}

export function listDevice(listQuery) {
  return request({
    url: '/device.dev/list',
    method: 'get',
    params: listQuery
  })
}

export function listDataPoint(deviceId) {
  return request({
    url: '/device.dev/listData',
    method: 'get',
    params: { deviceId }
  })
}

export function showDeviceAccessSecret(deviceId) {
  return request({
    url: '/device.dev/showAccessSecret',
    method: 'get',
    params: { deviceId }
  })
}
